<?php

namespace app\admin\model;

use think\Model;

class Gcategory extends Model{
    public static function test(){
        $model = self::field(true);
        return $model->select();
    }

    public static function jie($data=[]){
        if(!$data['id']){
            $list = self::where('parent_id',0)
                ->order('sort_order desc');

            return $list->select();
        }else{

            $list1 = self::where('parent_id',$data['id'])
                ->order('sort_order desc');
            return $list1->select();

        }
    }
    public static function fen(){
        $cate = self::field(true);
        return $cate->select();
    }
}